//
//  mmjMeCell.m
//  Social
//
//  Created by seirra on 2018/5/16.
//  Copyright © 2018年 mmj. All rights reserved.
//

#import "mmjMeCell.h"

@implementation mmjMeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        self.textLabel.textColor = [UIColor darkGrayColor];
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        //        self.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow"]];
        self.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainCellBackground"]];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    if (self.imageView.image == nil) return;
    
    // imageView
    self.imageView.mmj_y = mmjSmallMargin;
    self.imageView.mmj_height = self.contentView.mmj_height - 2 * mmjSmallMargin;
    self.imageView.mmj_width = self.imageView.mmj_height;
    
    // label
    self.textLabel.mmj_x = self.imageView.mmj_right + mmjMargin;
}

@end
